📑 api: Update openapi docs and code generation#397
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the codebase to align with updated OpenAPI specifications and regenerated API client code. The changes primarily involve renaming API methods, updating parameter types from String to their proper types (Int32, Int64, enum values), and removing the createdAt field from the Friend model.
Changes:
- Updated API method names to match new OpenAPI specifications (e.g.,
getBrief→getTimetableBriefs,searchLecture→searchLectures) - Changed parameter types from String to proper types (Int32, Int64, enum types) across multiple API calls
- Removed
createdAtfield from Friend model and all related code
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| TimetableAPIRepository.swift | Updated API method names and parameter types for timetable operations |
| LectureSearchAPIRepository.swift | Changed API method name and parameter types for lecture search |
| LectureAPIRepository.swift | Updated parameter types and API method names for lecture operations |
| CourseBookAPIRepository.swift | Changed API method names and parameter types for course book operations |
| ThemeAPIRepository.swift | Updated API method name, removed debug code, and split payload methods |
| NotificationAPIRepository.swift | Changed API method name and parameter types for notifications |
| FriendManageOptionSheet.swift | Removed createdAt parameter from Friend initialization in preview |
| FriendEditDisplayNameSheet.swift | Removed createdAt parameter from Friend initialization in preview |
| FriendRequestViewModel.swift | Removed unused return value assignment |
| FriendsAPIRepository.swift | Updated Friend model usage, removed createdAt field, changed API method return type |
| FakeFriendsRepository.swift | Removed createdAt field from Friend initializations |
| FriendsRepository.swift | Changed requestFriend method signature to return void |
| Friend.swift | Removed createdAt property from Friend model |
| AuthAPIRepository.swift | Updated API method names and added missing parameter |
| id: response.first.id ?? "", | ||
| userId: response.second.id ?? "", | ||
| nickname: response.second.nicknameWithoutTag, | ||
| tag: String(response.second.nicknameTag), |
There was a problem hiding this comment.
Using optional chaining with empty string fallbacks (e.g., response.first.id ?? '') can mask API contract violations. If these IDs are truly required, the code should fail explicitly rather than silently defaulting to empty strings, which could lead to bugs downstream where empty IDs are used.
| fileprivate func toModifyPayload() -> Components.Schemas.TimetableThemeModifyRequestDto { | ||
| .init( | ||
| colors: colors.map { .init(bg: $0.bgHex, fg: $0.fgHex) }, | ||
| name: name | ||
| ) | ||
| } |
There was a problem hiding this comment.
The toAddPayload() and toModifyPayload() methods contain identical implementations. Consider consolidating them into a single method or extracting the shared logic to avoid duplication.
No description provided.